package com.goldman.aplt.service.rule;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.goldman.aplt.entity.rule.AppRule;
import com.goldman.aplt.repo.rule.AppRuleMapper;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lenovo
* @description 针对表【app_rule】的数据库操作Service实现
* @createDate 2024-07-16 17:43:21
*/
@Service
@CacheConfig(cacheNames = "${systemId}:AppRuleService")
public class AppRuleService extends ServiceImpl<AppRuleMapper, AppRule>{

    @Cacheable
    public AppRule getOneByRuleId(String ruleId) {
        return this.lambdaQuery().eq(AppRule::getRuleId, ruleId).one();
    }

    @Cacheable
    public List<AppRule> getListByScene(String sceneCode) {
        return this.lambdaQuery().eq(AppRule::getRuleSceneCode, sceneCode).list();
    }

}




